package com.edu.edumanager.mapper;

import com.edu.edumanager.bean.EduChapter;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @program: edu-manager
 * @description:
 * @author: Jaime
 * @create: 2021-08-17 16:36
 **/
@Mapper
public interface EduChapterMapper {
    /**
     * 添加chapter到表chapter
     * @param chapter
     * @return
     */
    int addChapter(EduChapter chapter);

    /**
     * 依照课程ID查章节表
     * @param chapterId
     * @return
     */
    EduChapter getChapterById(Integer chapterId);

    /**
     *  两表联查 返回页面结构
     * @param courseId
     * @return
     */
    List<EduChapter> findChapterAndVideo(Integer courseId);

    int deleteChapterId(Integer chapterId);

    int updateChapter(EduChapter chapter);

    int deleteChapterByCourseId(Integer courseId);
}
